feat(web): customize diff colors and markers - #7347
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Two consistency findings on the new diff appearance settings. Everything else (palette class plumbing, StyledFileDiff extraction, settings routing/search wiring) looks consistent with the existing patterns.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
Two consistency findings in the new Appearance diff settings UI (apps/web/src/components/settings/SettingsPanels.tsx). Everything on the diff-rendering side (StyledDiffCodeView.tsx, diffRendering.ts) reads consistently: the palette is routed through --t3-diff-* with --success/--destructive fallbacks, so FilePreviewPanel's reuse of DIFF_SURFACE_THEME_UNSAFE_CSS is unaffected, and diffIndicators: "bars" keeps the existing [data-indicators="bars"] selected-line rules matching.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
Reviewed the diff-appearance settings UI and the shared diff surface wrapper. The palette plumbing (getDiffColorSchemeClassName → --t3-diff-* → --diffs-*-base/tint overrides) is now owned in one place and StyledFileDiff reuses it, which resolves the earlier duplication and base-color concerns. Two findings remain on the new Appearance tiles' Toggle class string.
Posted via Macroscope — UI Consistency
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR introduces a new user-facing feature with new settings types, new UI components, and dynamic styling logic. While the changes are cosmetic and well-scoped, new features introducing user-facing behavior warrant human review. You can add or adjust custom eligibility rules. Learn more. |
Dismissing prior approval to re-evaluate af66c02
There was a problem hiding this comment.
Two new Appearance selects and the standalone diff preview don't follow the settings row conventions in this file. Details inline.
Posted via Macroscope — UI Consistency
Dismissing prior approval to re-evaluate 13f3b9f
There was a problem hiding this comment.
UI consistency review of the diff appearance settings. Three findings: a preview that no longer sits with the setting it demonstrates, diff-panel chrome that stays red/green when the orange/blue palette is selected, and the new StyledFileDiff wrapper landing without a focused test for its forwarding contract. The Select controls now match the shared settings-row pattern (w-full sm:w-40, SettingsRow children slot), so earlier findings on those look resolved.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
One finding: the new diff palette stops at the diff surface, so the app-side +/- counts rendered directly above it keep the red/green colors. Details inline.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
One consistency gap in the new diff-palette contract, plus a small dead prop. Details inline.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0c1e164. Configure here.
|
@macroscope-app review |
|
Sorry, I'm unable to act on this request because you do not have permissions within this repository. |
…earance-settings # Conflicts: # apps/web/src/components/settings/SettingsFontPreviews.tsx
There was a problem hiding this comment.
Two consistency findings on the diff appearance work. The global DiffAppearanceSync token now makes the palette reachable app-wide, but two hand-rolled diff stats still hardcode red/green, and the settings-search catalog order no longer matches where the new rows render.
Posted via Macroscope — UI Consistency
| to: "/settings/appearance", | ||
| }, | ||
| { | ||
| id: "diff-colors", |
There was a problem hiding this comment.
searchSettings filters this array in place, and the catalog is documented as being "in result order" — the Appearance entries otherwise mirror the page exactly (scheme, themes, glass, environment identification, then the Typography rows). These two rows render inside Typography right after the Code font row, so listing them here puts them ahead of environment-identification and every font entry in search results.
Suggest moving both entries to sit between code-font and terminal-font so result order keeps matching page order.
Posted via Macroscope — UI Consistency
| <span aria-hidden="true" className="font-mono text-success"> | ||
| <span | ||
| aria-hidden="true" | ||
| className="font-mono text-[var(--t3-diff-addition-color,var(--success))]" |
There was a problem hiding this comment.
Now that DiffAppearanceSync puts --t3-diff-* on <html>, this label and PullRequestDiffStat follow the setting — but the two hand-rolled +N / −M stats do not: Sidebar.tsx:1543-1544 (text-emerald-600 dark:text-emerald-400 / text-red-600 dark:text-red-400) and GitActionsControl.tsx:1939-1941 plus the totals at 1952-1957 (text-success / text-destructive). Before this PR every diff stat was consistently red/green; with Orange and blue selected the sidebar thread rows and the commit sheet stay green/red beside blue/orange stats everywhere else.
Smallest fix: swap those four class strings for text-[var(--t3-diff-addition-color,var(--success))] / text-[var(--t3-diff-deletion-color,var(--destructive))], or render DiffStatLabel at those call sites so the palette has one owner.
Posted via Macroscope — UI Consistency

<!--
Thank you for contributing to T3 Code! Please note that only maintainers have merge access. Your PR will be reviewed by the team.
Important: We generally do not accept PRs that add new features, new providers, or introduce significant architectural changes without prior discussion.
For those ideas, please open an issue or proposal first so we can align on scope and approach.
-->
What Changed
+/-line indicators.Why
Diff colors and line indicators were fixed in the renderer, so users could not choose a more distinguishable palette or familiar patch markers. These settings keep the existing red/green bars as the default while offering accessible orange/blue colors and classic markers everywhere web/desktop diffs render.
UI Changes
Before
After
Checklist
Verification:
vp run --filter @t3tools/web typecheckgit diff --checkGenerated with GPT-5.6-sol in the Codex harness.
Note
Add user-configurable diff colors and marker styles to settings
diffColorScheme(red-green|orange-blue) anddiffIndicatorStyle(bars|classic) toClientSettingsSchemawith decoding defaults in settings.tsDiffAppearanceRowsin the Appearance settings panel with a liveDiffPreviewthat reflects both selections, plus searchable entries in settingsSearch.ts--t3-diff-addition-color,--t3-diff-deletion-color) viagetDiffColorSchemeClassNamein diffRendering.ts, and applies the scheme globally viaDiffAppearanceSyncin __root.tsxStyledFileDiffand updatesStyledDiffCodeViewto passdiffIndicatorsfrom settings so review comments and code views use shared appearanceDIFF_SURFACE_THEME_UNSAFE_CSSin diffRendering.ts rewires addition/deletion base colors to CSS variables with fallbacks; any out-of-tree diff surface not usinggetDiffColorSchemeClassNameorStyledFileDiffwill keep fixed red/green colors until updatedMacroscope summarized 60a1e37.
Note
Low Risk
UI and appearance preferences with backward-compatible defaults; no auth, data, or security-sensitive paths.
Overview
Adds user-configurable diff appearance via two persisted client settings: diff colors (red/green vs orange/blue) and diff markers (bars vs classic +/−).
Settings & contracts: New
diffColorSchemeanddiffIndicatorStyleonClientSettingswith defaultsred-greenandbars. Appearance settings gain Diff colors and Diff markers rows with liveDiffPreview, reset/search integration, and user docs.Rendering:
--t3-diff-addition-color/--t3-diff-deletion-colordrive diff surfaces globally (DiffAppearanceSyncondocument.documentElement), Pierre CSS overrides, and stat labels (DiffStatLabel, PR diff stats).StyledDiffCodeViewand newStyledFileDiffread settings and passdiffIndicatorsinto Pierre; timeline review-comment diffs useStyledFileDiffinstead of rawFileDiff.Reviewed by Cursor Bugbot for commit 60a1e37. Bugbot is set up for automated code reviews on this repo. Configure here.